<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/index.xhtml">
        <ui:define name="title"/>
        <ui:define name="body">
            <h:form>
                <p:panel id="panel" header="#{bundle.CreateTblNatilleraPersonaTitle}" style="margin-bottom:5px;">
                    <h:panelGroup id="messagePanel" layout="block">
                        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                    </h:panelGroup>

                    <h:panelGrid columns="3" cellpadding="3">

                        <p:outputLabel value="#{bundle.CreateTblNatilleraPersonaLabel_tblNatillera}" for="tblNatillera" />
                        <p:selectOneMenu id="tblNatillera" value="#{tblNatilleraPersonaController.selected.tblNatillera}" required="true" requiredMessage="#{bundle.CreateTblNatilleraPersonaRequiredMessage_tblNatillera}">
                            <h:selectOneMenu title="#{bundle.CreateTblNatilleraPersonaTitle_tblNatillera}"/>
                            <f:selectItems value="#{tblNatilleraController.itemsAvailableSelectOne}"/>
                            <f:validateLength minimum="2" />
                        </p:selectOneMenu>
                        <p:message for="tblNatillera" />

                        <p:outputLabel value="#{bundle.CreateTblNatilleraPersonaLabel_tblPersona}" for="tblPersona" />
                        <p:selectOneMenu id="tblPersona" value="#{tblNatilleraPersonaController.selected.tblNatilleraPersonaPK.docPersona}" required="true" requiredMessage="#{bundle.CreateTblNatilleraPersonaRequiredMessage_tblPersona}">
                            <h:selectOneMenu title="#{bundle.CreateTblNatilleraPersonaTitle_tblPersona}"/>
                            <f:selectItems value="#{tblPersonaController.itemsAvailableSelectOne}"/>
                            <f:validateLength minimum="2" />
                        </p:selectOneMenu>
                        <p:message for="tblPersona" />

                        <p:outputLabel value="#{bundle.CreateTblNatilleraPersonaLabel_socioRefiere}" for="socioRefiere" />
                        <p:selectOneMenu id="socioRefiere" value="#{tblNatilleraPersonaController.selected.socioRefiere}" >
                            <h:selectOneMenu title="#{bundle.CreateTblNatilleraPersonaTitle_socioRefiere}"/>
                            <f:selectItems value="#{tblPersonaController.itemsAvailableSelectOne}"/>
                            <f:validateLength minimum="2" />
                        </p:selectOneMenu>
                        <p:message for="socioRefiere" />

                        <p:outputLabel value="#{bundle.CreateTblNatilleraPersonaLabel_fecha}" for="fecha" />
                        <p:calendar id="fecha" value="#{tblNatilleraPersonaController.selected.fecha}" title="#{bundle.CreateTblNatilleraPersonaTitle_fecha}" required="true" requiredMessage="#{bundle.CreateTblNatilleraPersonaRequiredMessage_fecha}" effect="fold" pattern="dd-MM-yyyy">
                            <f:validateLength minimum="2" />
                        </p:calendar>
                        <p:message for="fecha" />

                        <p:outputLabel value="#{bundle.CreateTblNatilleraPersonaLabel_fechaLiquidacion}" for="fechaLiquidacion" />
                        <p:calendar id="fechaLiquidacion" value="#{tblNatilleraPersonaController.selected.fechaLiquidacion}" title="#{bundle.CreateTblNatilleraPersonaTitle_fechaLiquidacion}" effect="fold" pattern="dd-MM-yyyy">
                            <f:validateLength minimum="2" />
                        </p:calendar>
                        <p:message for="fechaLiquidacion" />

                        <p:outputLabel value="#{bundle.CreateTblNatilleraPersonaLabel_saldoAhorro}" for="saldoAhorro" />
                        <p:inputText id="saldoAhorro" value="#{tblNatilleraPersonaController.selected.saldoAhorro}" title="#{bundle.CreateTblNatilleraPersonaTitle_saldoAhorro}">
                            <f:validateLength minimum="2" />
                        </p:inputText>
                        <p:message for="saldoAhorro" />

                        <p:outputLabel value="#{bundle.CreateTblNatilleraPersonaLabel_saldoDeuda}" for="saldoDeuda" />
                        <p:inputText id="saldoDeuda" value="#{tblNatilleraPersonaController.selected.saldoDeuda}" title="#{bundle.CreateTblNatilleraPersonaTitle_saldoDeuda}">
                            <f:validateLength minimum="2" />
                        </p:inputText>
                        <p:message for="saldoDeuda" />

                        <p:outputLabel value="#{bundle.CreateTblNatilleraPersonaLabel_estado}" for="estado" />
                        <p:selectOneMenu id="estado" value="#{tblNatilleraPersonaController.selected.estado}"  required="true" requiredMessage="#{bundle.CreateTblNatilleraPersonaRequiredMessage_estado}">
                            <h:selectOneMenu title="#{bundle.CreateTblNatilleraPersonaTitle_estado}"/>
                            <f:selectItems value="#{tblEstadoController.itemsAvailableSelectOne}"/>
                            <f:validateLength minimum="2" />
                        </p:selectOneMenu>
                        <p:message for="estado" />
                        
                        <p:outputLabel value="#{bundle.CreateTblNatilleraPersonaLabel_tblUsuario}" for="tblUsuario" />
                        <p:selectOneMenu id="tblUsuario" value="#{tblNatilleraPersonaController.selected.tblUsuario}" >
                            <h:selectOneMenu title="#{bundle.CreateTblNatilleraPersonaTitle_tblUsuario}"/>
                            <f:selectItems value="#{tblUsuarioController.itemsAvailableSelectOne}"/>
                            <f:validateLength minimum="2" />
                        </p:selectOneMenu>
                        <p:message for="tblUsuario" />

                    </h:panelGrid>
                    <br />
                    <p:commandButton action="#{tblNatilleraPersonaController.create}" value="#{bundle.CreateTblNatilleraPersonaSaveLink}" update="panel"/>
                    <p:commandButton action="#{tblNatilleraPersonaController.prepareList}" value="#{bundle.CreateTblNatilleraPersonaShowAllLink}" immediate="true"/>

                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
